package main

import (
	"fmt"

	"gitee.com/gousing/uid"
)

func main() {
	myUidMachine, err := uid.NewUidMachine(20, 5, 11, 0, 2023001)
	if err != nil {
		panic(err)
	}
	uid := myUidMachine.NextID()
	info, err := myUidMachine.Parse(uid)
	if err != nil {
		panic(err)
	}
	fmt.Printf("uid: %d, info: %+v", uid, info)
	// Like: uid: 18623237461508096, info: &{WorkerId:0 Sequence:0 ServerTime:2025-04-28T16:05:21.910 +08:00 UnixMilli:1745827521910}
}
